import { setLang } from "@/i18n";
import { userStore } from "@/store/modules/user/user";
import { getUserProfile } from "../user";

export const setProfile = async () => {
  const store = userStore();
  const userInfo = await getUserProfile();
  store.$state.user = userInfo.data.user;
  store.$state.paths = userInfo.data.paths;
  store.$state.menus = userInfo.data.menus;
  store.$state.oss = userInfo.data.oss;
  const { lang } = userInfo.data.user;
  setLang(lang);
};
